#include <cstdio>
#include <vector>
#include <cstring>

using namespace std;

vector<int> li[ 100001 ];
int n, sg[ 100001 ];
bool visit[ 100001 ];

void init( )
{
    int i, u, v;
    scanf("%d", &n);
    memset( visit, 0, sizeof( visit ) );
    for ( i = 0; i < n; i++ ) li[ i ].clear( );
    for ( i = 0; i < n - 1; i++ )
    {
        scanf("%d%d", &u, &v); u--; v--;
        li[ u ].push_back( v );
        li[ v ].push_back( u );
    }
    visit[ 0 ] = 1;
}

int find( int p )
{
    int i;
    sg[ p ] = 0;
    for ( i = 0; i < li[ p ].size( ); i++ )
        if ( !visit[ li[ p ][ i ] ] )
        {
            visit[ li[ p ][ i ] ] = 1;
            sg[ p ] ^= find( li[ p ][ i ] ) + 1;
        }
    return sg[ p ];
}

int main( )
{
    int t;
    scanf("%d", &t);
    while ( t-- )
    {
        init( );
        find( 0 );
        if ( sg[ 0 ] )
            puts("Alice");
        else
            puts("Bob");
    }
    return 0;
}
